A depth map (English: Depth map) is an image representation form of presenting a distance from a focal plane to each point on an image by using a gray-scale diagram. For example, FIG. 1A is a three-dimensional view of a character, and FIG. 1B is a depth map of the character that is obtained based on FIG. 1A. When objects are at a same color level, it indicates that the objects are on a same focal plane, lighter gray indicates that an object is closer to the focal plane, and darker gray indicates that an object is farther away from the focal plane. During drawing of a depth map, a distance from a focal plane to each point of an object at a photographing moment, that is, depth information, usually needs to be measured or calculated.
Generally, there are three manners of obtaining depth information: a dual-camera/binocular manner, a structured light manner, and a time of flight (English: Time of Flight, ToF for short) manner.
In the binocular manner, at least two cameras are used to acquire an image, and a distance from each point on the image to a focal plane is calculated by using a triangle location algorithm, so as to obtain depth information.
However, due to the triangle location algorithm and a structural layout of the cameras, when a distance between a target object and a focal plane is less than a given value, depth information of the target object cannot be obtained by using the binocular manner, where the given value is referred to as a blind distance.
In the structured light manner, an infrared light source is generally used to light a target object, a particular pattern is projected to the target object, and depth information of each pixel point is calculated by using an offset of the pattern.
However, the structured light manner needs an infrared camera and an infrared light source, and the structured light manner has a relatively high requirement on a projected pattern, and is easily affected by an outdoor light source. As a measured distance is affected by a lighting source, the structured light manner is limited to being used in an indoor and short-distance scenario, for example, within a distance of 3 meters (unit: m). Once a distance between a target object and a focal plane exceeds a given distance, depth information cannot be obtained.
In the ToF manner, a phase of an infrared light source is modulated, and a phase offset of a received image is measured, so that depth information is measured.
Same as the structured light manner, the ToF manner also needs an infrared camera and an infrared light source, and the ToF manner is limited to being used in an indoor and short-distance scenario.
Therefore, due to respective limitations of the binocular manner, the structured light manner, and the ToF manner, regardless of which manner is used, it is possible that depth information of a target object cannot be obtained.